

************************************************************************************
******************** "Second-order Effects or Ideational Rifts? ******************** 
***** Explaining Outcomes of European Elections in an Era of Populist Politics" ****
**************************** Piret Ehin & Liisa Talving ****************************
******************** Italian Political Science Review 2020 *************************
************************************************************************************

clear 
set more off
use ".../Replication data"


*****Results in the order of appearance in the paper*****


/// Descriptives in the Data and Methods section ///

sum Difference
tab Populist, m
tab Farright, m
tab Farleft, m
tab Eurosceptic, m

tab Country Populist, m
tab Country Farright, m
tab Country Farleft, m
tab Country Eurosceptic, m

oneway VoteEP Party if Populist==1, tab
oneway VoteEP Party if Farleft==1, tab
tab VoteEP Country if Party=="SF"

tab Government, m
tab Government Populist, m
tab Government Farright, m
tab Government Farleft, m
tab Government Eurosceptic, m

sum VoteFOE
tab Country nat_el_sys_PR, m
sum Cycle


/// Generate electoral cycle squared ///

sum Cycle
gen Cycle2=Cycle^2
sum Cycle2


/// Table 1 ///

//Model 1
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 || Country:

//Model 2
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Populist || Country:

//Model 3
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farright || Country:

//Model 4
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farleft || Country:

//Model 5
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Eurosceptic || Country:
 
 
/// Table 1a in Appendix /// 

mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 || Country:
margins, at(VoteFOE=(2 55))
margins nat_el_sys_PR, at(VoteFOE=(2 55))


// Figure 1 ///

mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 || Country:
margins, dydx(VoteFOE) over(nat_el_sys_PR) 
marginsplot, xscale(range(-1 2)) recast(scatter)


/// Table 1b in Online appendix /// 

//DV measured as relative change in party vote shares
gen rel_change=Difference/VoteFOE
tab rel_change

//Model 1
mixed rel_change i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 || Country:

//Model 2
mixed rel_change i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Populist || Country:

//Model 3
mixed rel_change i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farright || Country:

//Model 4
mixed rel_change i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farleft || Country:

//Model 5
mixed rel_change i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Eurosceptic || Country:


//Descriptive statistics in Results

sum Difference if PEE==1
sum Difference if PEE==0

sum Difference if Populist==1
sum VoteFOE if Populist==1
sum VoteEP if Populist==1
oneway Difference Party if Populist==1, means

sum Difference if Eurosceptic==1
sum VoteFOE if Eurosceptic==1
sum VoteEP if Eurosceptic==1
oneway Difference Party if Eurosceptic==1, means

sum Difference if Farleft==1
sum VoteFOE if Farleft==1
sum VoteEP if Farleft==1
oneway Difference Party if Farleft==1, means
oneway Difference Party if Country=="Denmark" & Farleft==1, means

sum Difference if Farright==1
sum VoteFOE if Farright==1
sum VoteEP if Farright==1
oneway Difference Party if Farright==1, means


/// Table 2a in Appendix ///

//Model 1
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.PEE || Country:

//Model 2
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.PEE i.PEE#i.Government || Country:

//Model 3

mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.PEE i.PEE#c.VoteFOE || Country:

//Model 4
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.PEE i.PEE#i.Government i.PEE#c.Cycle i.PEE#c.Cycle2 i.PEE#i.Government#c.Cycle i.PEE#i.Government#c.Cycle2|| Country:


/// Table 3 in Appendix ///

//Model 1
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Populist i.Populist#i.Government || Country:

//Model 2
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farright i.Farright#i.Government || Country:

//Model 3
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farleft i.Farleft#i.Government || Country:

//Model 4
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Eurosceptic i.Eurosceptic#i.Government || Country:


/// Figure 2 ///

mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Populist i.Populist#i.Government || Country:
margins i.Populist#i.Government
mplotoffset, xscale(range(-1 2)) offset(0.05) recast(scatter) scheme(s2mono) graphregion(color(white))

mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farright i.Farright#i.Government || Country:
margins i.Farright#i.Government
mplotoffset, xscale(range(-1 2)) offset(0.05) recast(scatter) scheme(s2mono) graphregion(color(white))


/// Table 4 in Appendix ///

//Model 1
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Populist i.Populist#c.VoteFOE || Country:

//Model 2
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farright i.Farright#c.VoteFOE || Country:

//Model 3
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farleft i.Farleft#c.VoteFOE || Country:

//Model 4
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Eurosceptic i.Eurosceptic#c.VoteFOE || Country:


/// Figure 3 ///

mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Populist i.Populist#c.VoteFOE || Country:
margins, over(Populist) at(VoteFOE=(2(1)55))
marginsplot, scheme(s2mono) graphregion(color(white))

mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farright i.Farright#c.VoteFOE || Country:
margins, over(Farright) at(VoteFOE=(2(1)55))
marginsplot, scheme(s2mono) graphregion(color(white))


/// Table 2b in Online appendix ///

//Model 1
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Populist i.Populist#i.Government i.Populist#c.Cycle i.Populist#c.Cycle2 i.Populist#i.Government#c.Cycle i.Populist#i.Government#c.Cycle2|| Country:

//Model 2
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farright i.Farright#i.Government i.Farright#c.Cycle i.Farright#c.Cycle2 i.Farright#i.Government#c.Cycle i.Farright#i.Government#c.Cycle2|| Country:

//Model 3
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Farleft i.Farleft#i.Government i.Farleft#c.Cycle i.Farleft#c.Cycle2 i.Farleft#i.Government#c.Cycle i.Farleft#i.Government#c.Cycle2|| Country:

//Model 4
mixed Difference i.Government c.VoteFOE##i.nat_el_sys_PR c.Cycle c.Cycle2 i.Government#c.Cycle i.Government#c.Cycle2 i.Eurosceptic i.Eurosceptic#i.Government i.Eurosceptic#c.Cycle i.Eurosceptic#c.Cycle2 i.Eurosceptic#i.Government#c.Cycle i.Eurosceptic#i.Government#c.Cycle2|| Country:
